, const [] = ["cooking", "art", "history"] , const [, first]["cooking", "art", "history"] , const [first] = ["cooking", "art", "history"] " />  , const first = ["cooking", "art", "history"] , const [] = ["cooking", "art", "history"] , const [, first]["cooking", "art", "history"] , const [first] = ["cooking", "art", "history"] " />  , const [] = ["cooking", "art", "history"] , const [, first]["cooking", "art", "history"] , const [first] = ["cooking", "art", "history"] " />
Google News
logo
ReactJS - Quiz(MCQ)
To get the first item from the array ("cooking") using array destructuring, how do you adjust this line?

const topics = ['cooking', 'art', 'history'];
A)
const first = ["cooking", "art", "history"] 
B)
const [] = ["cooking", "art", "history"] 
C)
const [, first]["cooking", "art", "history"] 
D)
const [first] = ["cooking", "art", "history"] 

Correct Answer :   const [first] = ["cooking", "art", "history"]